Using
a Window or Thread to Manage Buffered Playback
The following
messages can be sent to a window or thread for managing playback of MIDI
system-exclusive messages or stream buffers:
MM_MOM_CLOSE |
Sent when
the device is closed by using the midiOutClose |
MM_MOM_DONE |
Sent when
the device driver is finished with a data block sent by using the midiOutLongMsg |
MM_MOM_OPEN |
Sent when
the device is opened by using the midiOutOpen |
A wParam
parameter and an lParam parameter are associated with each of these
messages. The wParam parameter always specifies the handle of an open
MIDI device. For MM_MOM_DONE
The most
useful message is probably MM_MOM_DONE. Unless you need to allocate memory or
initialize variables, you probably do not need to process MM_MOM_OPEN and
MM_MOM_CLOSE. When playback of a data block is complete, you can clean up and
free the data block.